home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / mail / metamail / contrib / ServiceMail / src / services / man.tcl < prev    next >
Encoding:
Text File  |  1993-05-10  |  826 b   |  28 lines

  1. # man: send back a manual page on a service
  2. #
  3.  
  4. proc man {switches envelope inputs } {
  5.   set mandir ~/doc/services
  6.   set manext .doc
  7.   if {[llength $switches] != 1} {
  8.     set switches man
  9.   }
  10.  
  11.   setfield response DESCRIPTION "Results of your man request"
  12.  
  13.   if {[file exists [glob $mandir$switches$manext]]} {
  14.     setfield response STRING [exec cat [glob $mandir$switches$manext]];
  15.   } else {
  16.     setfield response STRING [concat "
  17. No information is available about this service.  The service either does not 
  18. exist or does not have a manual page. A list of currently available services 
  19. can be obtained using the 'services' service.
  20. -------------------------------------------------------------------------------
  21. |
  22. |
  23. " [exec cat [glob ${mandir}services${manext}]]]
  24.   }
  25.   return [mailout [turnaround $envelope] $response];
  26. }
  27.     
  28.